package com.lc.recovery.adapter;

import android.content.Context;

import java.util.List;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

/**
 * Created by lenovo on 2018/5/29.
 */
//FragmentPagerAdapter   FragmentStatePagerAdapter
public class MyFragmentPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    private Context mContext;
    private List<String> HomePageList;


    public MyFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragmentList, Context mContext, List<String> HomePageList) {
        super(fm);
        this.fragmentList=fragmentList;
        this.mContext=mContext;
        this.HomePageList=HomePageList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }


    @Override
    public int getCount() {
        return  fragmentList.size();
    }
    @Override
    public CharSequence getPageTitle(int position) { // 添加fragment标题
        return HomePageList.get(position);
    }


}
